package com.test.webchat.Controller;

import com.test.webchat.Pojo.Model.Message;
import com.test.webchat.Service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/message")
@RestController
public class MessageController {
    @Autowired
    private MessageService messageService;

    @RequestMapping("/getMessagesBySessionId")
    List<Message> getMessagesBySessionId(Integer sessionId){
        return messageService.getMessagesBySessionId(sessionId);
    }
}
